03. Get Access to GPU Instances
Amazon Web Services (AWS) is an Infrastructure as a Service (IaaS) and Platform as a Service (PaaS) provider. At this point, we may think of a "cloud" as a geographically distributed set of data centers that host different Virtual Machines (VMs) from different users. AWS has divided the entire world into several geographical regions. Each region has many availability zones, which in turn, comprises few data centers. Each data center has hundreds of servers, each of which hosts thousands of VMs dynamically.
A. What is EC2?
AWS Elastic Compute Cloud (EC2) is a hosted service that allows you to launch Virtual Machines (or an “instances”) , including instances with attached GPUs. You can get started by logging into the AWS Console and search for the "EC2" service, as shown below.
A.1. Launch an EC2 Instance
You can launch an instance in 7 simple steps, as follows:
- Choose an Amazon Machine Image (AMI) - An AMI is a template that contains the software configuration (operating system, application server, and applications) required to launch your instance.
- Choose an Instance Type - Instance Type offers varying combinations of CPUs, memory (GB), storage (GB), types of network performance, and availability of IPv6 support. AWS offers a variety of Instance Types, broadly categorized in 5 categories. You can choose an Instance Type that fits our use case. The specific type of GPU instance you should launch for this tutorial is called “p2.xlarge” .
- Configure Instance Details - Provide the instance count and configuration details, such as, network, subnet, behavior, monitoring, etc.
- Add Storage - You can choose to attach either SSD or Standard Magnetic drive to your instance.
- Add Tags - A tag serves as a label that you can attach to multiple AWS resources, such as volumes, instances or both.
- Configure Security Group - Attach a set of firewall rules to your instance(s) that controls the incoming traffic to your instance(s).
- Review - Review your instance launch details before the launch.
A.2. What is an Amazon Machine Image?
Amazon Machine Image or AMI is a template for an operating system and basic services (e.g., an application server and specific applications). By running an AMI instance, the AMI will be running "as a virtual server in the cloud" (as per AWS Documentation .
We will use this Deep Learning AMI (Amazon Linux) to define the operating system for your instance and to make use of its pre-installed software. In order to use this AMI, you must change your AWS region to one of the following (and you are encouraged to select the region in the list that is closest to you):
- EU (Ireland)
- Asia Pacific (Seoul)
- Asia Pacific (Tokyo)
- Asia Pacific (Sydney)
- US East (N. Virginia)
- US East (Ohio)
- US West (Oregon)
If you are unsure, please check the
AWS documentation
to confirm which region may be closest to you.
After changing your AWS region, view your
EC2 Service Limit report
at
this link
, and find your "Current Limit" for the p2.xlarge instance type.
A.3. Instance Type - What is a P2 instance?
P2 are powerful and scalable parallel processing GPU instances. You can read more about these on AWS Documentation .
B. Shut Down EC2 Instances, if not in use
Note: We recommend you shut down every resource (e.g., EC2 instances, or any other hosted service) on the AWS cloud immediately after the usage, otherwise you will run out of your free promo credits.
Even if you are in the middle of the project and need to step away,
PLEASE SHUT DOWN YOUR EC2 INSTANCE
. You can re-instantiate later.
We have provided adequate credits to allow you to complete your projects.
C. AWS Service Utilization Limits
You need to understand the way AWS imposes utilization quotas (limits) on almost all of its services.
- AWS provides default quotas, formerly referred to as limits , for each AWS service.
- Importantly, each quota is region-specific.
-
There are three ways to check your quotas, as mentioned
here
, i). Service Endpoints and Quotas, ii). Service Quotas console, and iii). AWS CLI commands.
- We recommend you to check the quotas for AWS EC2 at Service Endpoints and Quotas page.
- Alternatively, for EC2 service, you can visit Amazon EC2 Service Limits that describes how to view the current quota (limit) or request an increase in quota.
C.1. Increase EC2 Instance Limits
C.1.1. View Your Current Limit
After changing your AWS region, view your EC2 Service Limit report at this link , and find your "Current Limit" for the p2.xlarge instance type. By default, AWS sets a limit of 0 on the number of p2.xlarge instances a user can run , which effectively prevents you from launching this instance.
C.1.2. Submit a Limit Increase Request
If your limit of p2.xlarge instances is 0, you'll need to increase the limit before you can launch an instance.
- From the EC2 Service Limits page, CLICK TO EDIT Calculate vCPU limit on top.
-
The following screen pops up. In the
Instance type
search for p2.xlarge and the
Instance count
to 1, verify the
New limit
is showing
4 vCPUs
and then click on
Request limit increase
Note: You won't be charged for requesting a limit increase. AWS will only charge you once you have launched the instance.
- This will open the following screen. Click on the Service limit increase if it is not already selected.
- In Requests section pick your "Primary Instance type" as "All P instances" and "1" for "New limit value" Note: If you have never launched an instance of any type on AWS, you might receive an email from AWS Support asking you to initialize your account by creating an instance before they approve the limit increase.
C.1.3. Wait for the Approval
You must wait for AWS to approve your Limit Increase Request. AWS typically approves these requests within 48 hours.
IMPORTANT NOTICE: This is the current AWS UI as of April 6th, 2020. The AWS UI is subject to change on a regular basis. We advise students to refer to AWS documentation for the above process.